<template>
  <div class="box">
    <div class="userinfo">
      <img src="../../assets/2.jpg" alt="" />
      <div class="info">
        <div class="author">火星网友1</div>
        <div class="date">2小时前</div>
      </div>
      <div class="huifu">回复</div>
    </div>
    <!-- !!!不要把parent不该大写的地方大写了！！ -->
    <Parent :parentData="commentDate.parent" v-if="commentDate.parent" />
    <div class="maincontent">
      {{ commentDate.content }}
    </div>
  </div>
</template>

<script>
import Parent from "./Parent";
export default {
  components: {
    Parent,
  },
  props: ["commentDate"],
};
</script>

<style lang="less" scoped>
.box {
  padding: 10 / 360 * 100vw;
  border-bottom: 1px solid #ccc;
  .userinfo {
    display: flex;
    margin-bottom: 4 / 360 * 100vw;
    // align-items: center;
    img {
      width: 35 / 360 * 100vw;
      height: 35 / 360 * 100vw;
      border-radius: 50%;
      object-fit: cover;
    }
    .info {
      flex-grow: 1;
      padding-left: 10 / 360 * 100vw;
      .author {
        font-size: 14 / 360 * 100vw;
        color: #333;
      }
      .date {
        font-size: 12 / 360 * 100vw;
        color: #888;
      }
    }
    .huifu {
      font-size: 14 / 360 * 100vw;
      color: #888;
    }
  }
  .maincontent {
    font-size: 16 / 360 * 100vw;
    color: #333;
    margin-top: 6 / 360 * 100vw;
  }
}
</style>